package com.Enum;

public enum B {
    X(){
        @Override
        public void go() {

        }
    },Y("张三"){
        @Override
        public void go() {
            System.out.println(getName()+"再跑");
        }
    };
    //抽象枚举
    public abstract void go();
    private String name;

    B() {//私有构造器
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    B(String name) {
        this.name = name;
    }
}
